<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/pub/head_bootstrap.inc"%>
<link href="${baseURL}/themes/plugin/bootstrap/css/bootstrap.css"
	rel="stylesheet" type="text/css" />
	<link
	href="${baseURL}/themes/plugin/bootstrap-dialog/css/bootstrap-dialog.css"
	rel="stylesheet" type="text/css" />
<link href="${baseURL}/themes/plugin/bootstrapTable/bootstrap-table.css"
	rel="stylesheet" type="text/css" />
	<link href="${baseURL}/themes/blue/css/sys.css" rel="stylesheet"
		type="text/css" />
		<link href="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="${baseURL}/themes/default/css/sdApp.min.css" rel="stylesheet" type="text/css" /> 
<link href="${baseURL}/themes/blue/css/new_css.css?v=1" rel="stylesheet" type="text/css" /> 
<link href="${baseURL}/themes/default/css/animate.min.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="${baseURL}/assets/css/font-awesome-02.min.css" />
<%--八斗通用字体图标 --%>
<link href="${baseURL}/themes/common/bd-iconfont/iconfont.css" rel="stylesheet" type="text/css" />
	<script src="${baseURL}/js/jquerys/jquery-1.12.1.min.js"
		type="text/javascript"></script>
	<script src="${baseURL}/themes/plugin/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>
	<script
		src="${baseURL}/themes/plugin/bootstrap-dialog/js/bootstrap-dialog.js"
		type="text/javascript"></script>

	<script
		src="${baseURL}/themes/plugin/bootstrapTable/bootstrap-table.js"
		type="text/javascript"></script>
	<script
		src="${baseURL}/themes/plugin/bootstrapTable/locale/bootstrap-table-zh-CN.min.js"
		type="text/javascript"></script>

<script src="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script> 
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script> 
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script> 
<script src="${baseURL}/js/sdAppFrameworkAddressBook.js" type="text/javascript"></script>
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script>  
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script> 
<%--扩展jquery.validate (Cyan) --%>
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/jquery-validation/jquery.validate.extend.js" type="text/javascript"></script> 
 <script src="${baseURL}/themes/plugin/ligerUI_latest/lib/jquery/jquery.form.js" type="text/javascript"></script>
<script src="${baseURL}/themes/plugin/ligerUI_latest/lib/jquery-validation/messages_cn.js" type="text/javascript"></script>
		<script src="${baseURL}/js/BT.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="${baseURL}/themes/plugin/color_select/css/color_select.css">
		<title>Edit-${basePageTitle}</title>
		<style>
.l-group span {
	float: none;
}

.l-text.l-text-combobox {
	width: 250px;
}
.bootstrap-dialog-message{text-align:center;}
.bootstrap-dialog-message>p{text-align:center;}
.bootstrap-dialog-message>h4{text-align:center;}
.bootstrap-dialog-footer-buttons{text-align:center;}
</style>
<title>Edit</title>
</head>
<body>
	<div class="FrameWindow tabFrameWindow">
		<div class="window-menu" style="width:97%">
			<div class="menuInner">
				<button type="button" class="btn btn-normal btn-blue"
					onclick="FF_Save()">保存</button>
				<button type="button" class="btn btn-normal btn-white"
					onclick="FF_Cancel()">取消</button>
			</div>
		</div>
		<!-- window-menu -->
		<div class="FrameWindowInner">
			<div class="location"
				style="height: 32px; letter-spacing: 2px; color: #525771">
				<i class="fa fa-map-marker"
					style="color: #2684ce; font-size: 18px; vertical-align: top; margin-right: 8px; margin-bottom: -2px"></i>基本信息
			</div>

			<!-- top-card -->

			<div class="cont-table tab-content">
				<!-- 机构信息 -->
				<div class="tab-pane fade in active" id="mainTab">
					<form onsubmit="return false;" id="mainform" class="table-normal"
						enctype="multipart/form-data">
						<div class="cont-table tab-content" style="width: 98%">
							<table>
								<tbody>
									<tr>
										<input type="hidden" name="id" id="id" value="${id}">
									</tr>
									<tr>
										<input type="hidden" name="menuId" id="menuId"
											value="${param.menuId}">
									</tr>
									<tr>
										<th align="right"><font color="red">*</font>编码：</th>
										<td><input id="code" name="code"
											class="illegalRequest" type="text" validate="{required:true}"/></td>



									</tr>
									<tr>
										<th align="right"><font color="red">*</font>名称：</th>
										<td><input maxlength="1000" inputwidth="365" id="name"
											name="name" class="illegalRequest" type="test"
											style="height: 30px"  validate="{required:true}"/></td>
									</tr>
									<tr>
										<th align="right"><font color="red">*</font>路径：</th>
										<td><input maxlength="1000" inputwidth="365" id="url"
											name="url" class="illegalRequest" type="text"
											style="height: 30px"  validate="{required:true}"/></td>
									</tr>
								</tbody>
							</table>
						</div>
					</form>

				</div>
			</div>


			<script type="text/javascript">
			var baseUrl = '${baseURL}/report/template/templateview';
		//添加验证
		jQuery.metadata.setType("attr", "validate");
/* 		LG.validate(mainform); */
		//保存
		function FF_Save() {
			//编辑，新增
			var mainform = $("#mainform");
			mainform
					.attr("action",
							baseUrl + "save/save.do?id=${id}");
			BT.submitForm(mainform, function(data) {
				var win = parent || window;
				if (data && data.hasOk) {
					try {
	    				BT.showSuccess('操作成功!',function(){
	    					// 关闭窗口 刷新父窗口
	    					//window.history.go(-1);
	    					win.LG.closeAndReloadParent("TemplateView",
							"${param.menuId}");
	    					
	    				});

					} catch (e) {
	    				BT.showSuccess('操作成功!',function(){
	    					// 关闭窗口 刷新父窗口
	    					window.history.go(-1);
	    				});
					}
				} else {
					BT.showError("操作失败!失败信息如下:\n" + data.message + "\n如您对以上信息有疑问，请联系管理人员!");
				}
			});
		}
		//取消按钮，即关闭窗体
		function FF_Cancel() {
			try {
				var win = parent || window;
				win.LG.closeCurrentTab("TemplateView");
			} catch (e) {
				window.history.go(-1);
			}
		}
	</script>
	<script type="text/javascript">
	var pkId = '${id}';
	if(pkId != null && pkId != ''){
		//load data
		$.ajax({
			type: "get",
			url: baseUrl + 'edit/editJSON.do?id=${id}',
			dataType : "json",
		success: function(data){
			if(data){
				$("#code").val(data.code);
				$("#name").val(data.name);
				$("#url").val(data.url);
			}
		}
	 });
	} 
	</script>
</body>
</html>